Counting modules in a database

Can any one help me to count the number of module in my doors data base? I knew i miss something here, This code is working only for project level only.

Module m
int count = 0
for m in database do {
print m."Name" "\n"
count++
}

Thanks!
Raj
SystemAdmin - Tue May 05 10:23:28 EDT 2009

Re: Counting modules in a database
llandale - Tue May 05 11:30:25 EDT 2009

This thread has generic recursive function to find modules in a folder:

https://www.ibm.com/developerworks/forums/thread.jspa?messageID=14224190&#14224190

Re: Counting modules in a database
AnitaS - Fri Apr 10 09:26:17 EDT 2015

llandale - Tue May 05 11:30:25 EDT 2009
This thread has generic recursive function to find modules in a folder:

https://www.ibm.com/developerworks/forums/thread.jspa?messageID=14224190&#14224190

I used following script to count number of modules in  a folderr. It only count number of open modules. How do I count all the modules in a folder?

int mCount = 0
Module m
Folder f = current
for m in f do
{mCount++}

print mCount " "

Re: Counting modules in a database
O.Wilkop - Fri Apr 10 09:36:30 EDT 2015

AnitaS - Fri Apr 10 09:26:17 EDT 2015

I used following script to count number of modules in  a folderr. It only count number of open modules. How do I count all the modules in a folder?

int mCount = 0
Module m
Folder f = current
for m in f do
{mCount++}

print mCount " "

Item i;
Folder f = current;

for i in f do{
    if(type(i)=="Formal"){
        print "Module found\n";
    }
}

type(i) returns "Formal", "Project", "Folder", "Link" or "Descriptive"